//
//  ButtonCustom.swift
//  GOFM
//
//  Created by siri on 2023/12/11.
//  Copyright © 2023 Glad. All rights reserved.
//

import SwiftUI

struct ButtonPrimarySmall: View {
    let type: ButtonTypeEnum = .primary
    let size: ButtonSizeEnum = .small
    let label: String
    let action: () -> Void
    
    init(label: String,  action: @escaping () -> Void) {
        self.label = label
        self.action = action
    }
    
    var body: some View {
        ButtonCustom(type: type, size: size,label: label, action: action)
    }
}


struct ButtonPrimaryMedium: View {
    let type: ButtonTypeEnum = .primary
    let size: ButtonSizeEnum = .medium
    let label: String
    let action: () -> Void
    
    init(label: String,  action: @escaping () -> Void) {
        self.label = label
        self.action = action
    }
    
    var body: some View {
        ButtonCustom(type: type, size: size,label: label, action: action)
    }
}



struct ButtonPrimaryLarge: View {
    let type: ButtonTypeEnum = .primary
    let size: ButtonSizeEnum = .large
    let label: String
    let action: () -> Void
    
    init(label: String,  action: @escaping () -> Void) {
        self.label = label
        self.action = action
    }
    
    var body: some View {
        ButtonCustom(type: type, size: size,label: label, action: action)
    }
}



struct ButtonPrimary_Previews: PreviewProvider {
    static var previews: some View {
        VStack{
            ButtonPrimaryLarge(label: "移动端大按钮", action: {})
                .disabled(false)
            
            ButtonPrimaryLarge(label: "移动端大按钮", action: {})
                .disabled(true)
            
            ButtonPrimaryMedium(label: "移动端中按钮", action: {})
                .disabled(false)
            
            ButtonPrimaryMedium(label: "移动端中按钮", action: {})
                .disabled(true)
            
            ButtonPrimarySmall(label: "小按钮", action: {})
                .disabled(false)
            
            ButtonPrimarySmall(label: "小按钮", action: {})
                .disabled(true)
            
        }
    }
}
